import { ExpeditionOrder } from './../../app/models/expeditionOrder';
export class SeedDataManage {
    static current = new SeedDataManage();
    generateExpeditionOrder() {
        const order: ExpeditionOrder = JSON.parse(this.orderTemplate);
        order.qty = order.items.map(item => item.qty).reduce((acc, val) => {
            return acc + val;
        }, 0);
        return order;
    }

    private orderTemplate = `
        {
            "id":"${new Date().getTime()}id","seriaNo":"${new Date().getTime()}","status":"init","expediteFinishTime":${new Date().getTime()},
            "items":[
                {"id":"${new Date().getTime()}item1","qty":5,"refundQty":0,"status":"init","inventoryCode":"qe","inventoryId":"eqwe","inventoryName":" 哈哈","categories":[{"id":"67ihd9u5fag48ok004sokscsc","name":"4324234"}]},
                {"id":"${new Date().getTime()}item2","qty":5,"refundQty":0,"status":"init","inventoryCode":"qe","inventoryId":"eqwe","inventoryName":" 哈哈","categories":[{"id":"67ihd9u5fag48ok004sokscsc","name":"4324234"}]},
                {"id":"${new Date().getTime()}item3","qty":5,"refundQty":0,"status":"init","inventoryCode":"qe","inventoryId":"eqwe","inventoryName":" 哈哈","categories":[{"id":"67ihd9u5fag48ok004sokscsc","name":"4324234"}]}
            ]
        }
    `
} 